<?php

namespace services\models;

/**
 * This is the model class for table "d_try.order_express".
 *
 * @property integer $order_express_id
 * @property integer $order_info_id
 * @property string  $consignee
 * @property string  $province
 * @property string  $city
 * @property string  $county
 * @property string  $telephone
 * @property string  $mobile_phone
 * @property string  $address
 * @property string  $zip
 * @property integer $delivery_id
 * @property string  $delivery_code
 * @property integer $delivery_time
 * @property string  $create_time
 */
class OrderExpress extends \common\models\OrderExpress
{

    /**
     * 上海使用邮政发送 4
     * 其它地区使用韵达快递 1
     * @param bool $insert
     * @return bool
     */
    public function beforeSave($insert)
    {
        $this->delivery_code = '';
        $this->delivery_id   = 4;
        if (strpos($this->province, '上海') !== 0) {
            $this->delivery_id = 1;
        }
        return parent::beforeSave($insert);

    }


}
